<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <title>Egret</title>
    <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="full-screen" content="true"/>
    <meta name="screen-orientation" content="portrait"/>
    <meta name="x5-fullscreen" content="true"/>
    <meta name="360-fullscreen" content="true"/>
    <style>
        html, body {
            -ms-touch-action: none;
            background: #888888;
            padding: 0;
            border: 0;
            margin: 0;
            height: 100%;
        }
    </style>

    <!--这个标签为通过egret提供的第三方库的方式生成的 javascript 文件。删除 modules_files 标签后，库文件加载列表将不会变化，请谨慎操作！-->
    <!--modules_files_start-->
	<script egret="lib" src="libs/modules/egret/egret.js" src-release="libs/modules/egret/egret.min.js"></script>
	<script egret="lib" src="libs/modules/egret/egret.web.js" src-release="libs/modules/egret/egret.web.min.js"></script>
	<script egret="lib" src="libs/modules/game/game.js" src-release="libs/modules/game/game.min.js"></script>
	<script egret="lib" src="libs/modules/res/res.js" src-release="libs/modules/res/res.min.js"></script>
	<script egret="lib" src="libs/modules/tween/tween.js" src-release="libs/modules/tween/tween.min.js"></script>
	<!--modules_files_end-->

    <!--这个标签为不通过egret提供的第三方库的方式使用的 javascript 文件，请将这些文件放在libs下，但不要放在modules下面。-->
    <!--other_libs_files_start-->
    <script egret="lib" src="polyfill/promise.js" src-release="polyfill/promise.min.js"></script>
    <!--other_libs_files_end-->

    <!--这个标签会被替换为项目中所有的 javascript 文件。删除 game_files 标签后，项目文件加载列表将不会变化，请谨慎操作！-->
    <!--game_files_start-->
	<script egret="game" src="bin-debug/AnchorTest.js"></script>
	<script egret="game" src="bin-debug/CardMain.js"></script>
	<script egret="game" src="bin-debug/DispalyObject.js"></script>
	<script egret="game" src="bin-debug/HelloTime.js"></script>
	<script egret="game" src="bin-debug/HelloWorld.js"></script>
	<script egret="game" src="bin-debug/HitTest.js"></script>
	<script egret="game" src="bin-debug/LoadingUI.js"></script>
	<script egret="game" src="bin-debug/Main.js"></script>
	<script egret="game" src="bin-debug/Mask.js"></script>
	<script egret="game" src="bin-debug/MyCard.js"></script>
	<!--game_files_end-->
</head>
<body>

    <div class="guanzu">

    </div>

    <audio src="resource/assets/mp3/bgm.mp3" preload="preload" id="bgm" loop="loop"></audio>

    <audio src="resource/assets/mp3/biu.mp3" preload="preload" id="biu"></audio>
    <audio src="resource/assets/mp3/boom.mp3" preload="preload" id="boom"></audio>
    <!--引入jquery-->
    <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>

<script>
    $staticUrl='';
        function playAudio(id, isZero) {
            var obj = document.getElementById(id);
            if (isZero) {
                if (obj) obj.currentTime = 0;
            }
            if (typeof WeixinJSBridge != "undefined") {
                WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
                    if (obj) obj.play();
                });
            } else {
                if (obj) obj.play();
            }
        }
        function stopAudio(id) {
            var obj = document.getElementById(id);
            if (typeof WeixinJSBridge != "undefined") {
                WeixinJSBridge.invoke('getNetworkType', {}, function (e) {
                    if (obj) obj.pause();
                });
            } else {
                if (obj) obj.pause();
            }
        }
        var startAjax = function (callback, errorCallback, thisObj) {

            callback.call(thisObj, { 'success': true });
        };
        var endAjax = function (num,callback, errorCallback, thisObj) {

            callback.call(thisObj, { 'success': true, 'courseId': 1 });
        };

        function setWinSize() {
            if (window.innerWidth)
                winWidth = window.innerWidth;
            else if ((document.body) && (document.body.clientWidth))
                winWidth = document.body.clientWidth;
            // 获取窗口高度
            if (window.innerHeight)
                winHeight = window.innerHeight;
            else if ((document.body) && (document.body.clientHeight))
                winHeight = document.body.clientHeight;
            if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
                winHeight = document.documentElement.clientHeight;
                winWidth = document.documentElement.clientWidth;
            }
            GameWidth = 750;
            GameHeight = 1206;
            if (winWidth / winHeight > 750 / 1206) {
                GameWidth = winWidth / winHeight * 1206;
                console.log(GameWidth);
                mode = 'noBorder';
            } else {
                GameHeight = winHeight / winWidth * 750;
                mode = 'noBorder';
            }

        }
        setWinSize();
    </script>

<script>
        var mainHtml = '<section style="margin: auto;width: 100%;height: 100%;" class="page egret-player"\
        data-entry-class="Main"\
        data-orientation="portrait"\
        data-scale-mode="'+ mode + '"\
        data-frame-rate="30"\
        data-content-width="'+ GameWidth + '"\
        data-content-height="'+ GameHeight + '"\
        data-show-paint-rect="false"\
        data-multi-fingered="2"\
        data-show-fps="false" data-show-log="false"\
        data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">\
    </section>';
        document.write(mainHtml);
</script>


    <script>


        // var startAjax = function () {

        // }
        //  var endAjax = function () {

        // }
        var rankShow = function () {
            console.log('盘行帮');
        }

        var musicPlay = function () {
            $("#bgm")[0].play();
        }
        var musicPause = function () {
            $("#bgm")[0].pause();
        }

        /**
         * {
         * "renderMode":, //引擎渲染模式，"canvas" 或者 "webgl"
         * "audioType": "" //使用的音频类型，0:默认，1:qq audio，2:web audio，3:audio
         * "antialias": //WebGL模式下是否开启抗锯齿，true:开启，false:关闭，默认为false
         * }
         **/
        egret.runEgret({renderMode:"webgl", audioType:0});
    </script>
</body>
</html>
